class MyQueue {
public:

    MyQueue() {
        
    }
    
    void push(int x) {
        enter.push(x);
    }
    
    int pop() {
        int ret=peek();
        exit.pop();
        return ret;
    }

    int peek() {
        if(exit.empty()){
            while(!enter.empty()){
                exit.push(enter.top());
                enter.pop();
            }
        }
        return exit.top();
    }

    bool empty() {
        return enter.empty()
            && exit.empty();
    }
    stack<int> enter;
    stack<int> exit;
};